
#ifndef __APR_TABLE_H
#define __APR_TABLE_H

#include <apr_tables.h>
#include <vector>
#include "../iface/debug.h"

/** A wrapper around APR tables. */
class APRTable
{
   public:
      APRTable(apr_pool_t *imp);
      APRTable(int initentries, apr_pool_t *imp);
      APRTable(const APRTable &o);
      APRTable &operator=(const APRTable &o);
      ~APRTable();
      void copy(const APRTable &o);
      void set(const char *key, const char *value);
      const char *get(const char *format, ...) const PRINTF_LIKE(2, 3);
      bool isEmpty();
      void reset();
      std::vector<char *> *getAllAsStringList(const char *keyvalsep, const char *endsep);
   private:
      /** The core APR table object. */
      apr_table_t *ttable;
      /** The parent pool of this object. */
      apr_pool_t *parent_mp;
      /** The associated memory pool with this object. */
      apr_pool_t *mp;
};

#endif
